﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace ST.Buz.Base.Entity
{
	/// <summary>
	/// 单位信息表
	/// </summary>
	[Table("Sys_Organization")]
	[Serializable]
	public partial class Sys_Organization
	{
		/// <summary>
		/// 
		/// </summary>
		[Key]
		[Column("ID")]
		public int ID { get; set; }

		/// <summary>
		/// 机构类型
		/// <see cref="ST.Buz.Base.Enums.OrganizationType"/>
		/// </summary>
		[Column("Type")]
		public int Type { get; set; }

		[Column("PID")]
		public int PID { get; set; }

		/// <summary>
		/// 关联的IMS_Partner ID
		/// <see cref="ST.Buz.Base.Entity.IMS_Partner"/>
		/// </summary>
		[Column("PartnerID")]
		public int PartnerID { get; set; }

		/// <summary>
		/// 关联的IMS_Partner Name
		/// </summary>
		[Column("PartnerName")]
		[StringLength(120, ErrorMessage = "{0}长度不能超过{1}")]
		public string PartnerName { get; set; }

		/// <summary>
		/// 地区ID
		/// </summary>
		[Column("AreaID")]
		public int AreaID { get; set; }

		/// <summary>
		/// 编码
		/// </summary>
		[Display(Name = "编码")]
		[Column("Code")]
		[Required(ErrorMessage = "{0}不能为空")]
		[StringLength(32, ErrorMessage = "{0}长度不能超过{1}")]
		public string Code { get; set; }

		/// <summary>
		/// 名称
		/// </summary>
		[Display(Name = "名称")]
		[Column("Name")]
		[Required(ErrorMessage = "{0}不能为空")]
		[StringLength(50, ErrorMessage = "{0}长度不能超过{1}")]
		public string Name { get; set; }

		/// <summary>
		/// 
		/// </summary>
		[Column("PYCode")]
		[StringLength(10, ErrorMessage = "{0}长度不能超过{1}")]
		public string PYCode { get; set; }

		/// <summary>
		/// 法人
		/// </summary>
		[Column("LegalMan")]
		[StringLength(50, ErrorMessage = "{0}长度不能超过{1}")]
		public string LegalMan { get; set; }

		/// <summary>
		/// 法人身份证号
		/// </summary>
		[Column("LegalManIDCardNo")]
		[StringLength(20, ErrorMessage = "{0}长度不能超过{1}")]
		public string LegalManIDCardNo { get; set; }

		/// <summary>
		/// 法人手机号
		/// </summary>
		[Column("LegalManPhone")]
		[StringLength(15, ErrorMessage = "{0}长度不能超过{1}")]
		public string LegalManPhone { get; set; }

		/// <summary>
		/// 负责人
		/// </summary>
		[Column("ChargeMan")]
		[StringLength(50, ErrorMessage = "{0}长度不能超过{1}")]
		public string ChargeMan { get; set; }

		/// <summary>
		/// 负责人身份证号
		/// </summary>
		[Column("ChargeManIDCardNo")]
		[StringLength(20, ErrorMessage = "{0}长度不能超过{1}")]
		public string ChargeManIDCardNo { get; set; }

		/// <summary>
		/// 负责人手机号
		/// </summary>
		[Column("ChargeManPhone")]
		[StringLength(15, ErrorMessage = "{0}长度不能超过{1}")]
		public string ChargeManPhone { get; set; }

		/// <summary>
		/// 营业执照号
		/// </summary>
		[Column("CertificateNo")]
		[StringLength(50, ErrorMessage = "{0}长度不能超过{1}")]
		public string CertificateNo { get; set; }

		/// <summary>
		/// 固定电话
		/// </summary>
		[Column("Phone")]
		[StringLength(50, ErrorMessage = "{0}长度不能超过{1}")]
		public string Phone { get; set; }

		/// <summary>
		/// 传真
		/// </summary>
		[Column("Fax")]
		[StringLength(50, ErrorMessage = "{0}长度不能超过{1}")]
		public string Fax { get; set; }

		/// <summary>
		/// Email
		/// </summary>
		[Column("EMail")]
		[StringLength(50, ErrorMessage = "{0}长度不能超过{1}")]
		public string EMail { get; set; }

		/// <summary>
		/// 邮编
		/// </summary>
		[Column("ZipCode")]
		[StringLength(10, ErrorMessage = "{0}长度不能超过{1}")]
		public string ZipCode { get; set; }

		/// <summary>
		/// 所在省
		/// </summary>
		[Column("Province")]
		[StringLength(50, ErrorMessage = "{0}长度不能超过{1}")]
		public string Province { get; set; }

		/// <summary>
		/// 所在市
		/// </summary>
		[Column("City")]
		[StringLength(50, ErrorMessage = "{0}长度不能超过{1}")]
		public string City { get; set; }

		/// <summary>
		/// 所在区/县
		/// </summary>
		[Column("District")]
		[StringLength(50, ErrorMessage = "{0}长度不能超过{1}")]
		public string District { get; set; }

		/// <summary>
		/// 所在乡镇
		/// </summary>
		[Column("Town")]
		[StringLength(50, ErrorMessage = "{0}长度不能超过{1}")]
		public string Town { get; set; }

		/// <summary>
		/// 详细地址
		/// </summary>
		[Column("DetailAddress")]
		[StringLength(200, ErrorMessage = "{0}长度不能超过{1}")]
		public string DetailAddress { get; set; }

		/// <summary>
		/// 经度 Longitude
		/// </summary>
		[Column("Lng")]
		[StringLength(50, ErrorMessage = "{0}长度不能超过{1}")]
		public string Lng { get; set; }

		/// <summary>
		/// 纬度 Latitude
		/// </summary>
		[Column("Lat")]
		[StringLength(50, ErrorMessage = "{0}长度不能超过{1}")]
		public string Lat { get; set; }

		/// <summary>
		/// 企业LOGO
		/// </summary>
		[Column("Logo")]
		[StringLength(200, ErrorMessage = "{0}长度不能超过{1}")]
		public string Logo { get; set; }

		/// <summary>
		/// 企业网址
		/// </summary>
		[Column("SiteUrl")]
		[StringLength(200, ErrorMessage = "{0}长度不能超过{1}")]
		public string SiteUrl { get; set; }

		/// <summary>
		/// 备注
		/// </summary>
		[Column("Comment")]
		[StringLength(500, ErrorMessage = "{0}长度不能超过{1}")]
		public string Comment { get; set; }

		/// <summary>
		/// 排序
		/// </summary>
		[Column("Sort")]
		public int Sort { get; set; }

		/// <summary>
		/// 状态
		/// </summary>
		[Column("StateNow")]
		public int StateNow { get; set; }

		/// <summary>
		/// 创建时间
		/// </summary>
		[Column("AddDate")]
		public DateTime AddDate { get; set; }

		/// <summary>
		/// 创建人ID
		/// </summary>
		[Column("AddManID")]
		[JsonIgnore]
		public int AddManID { get; set; }

		/// <summary>
		/// 创建人
		/// </summary>
		[Column("AddManName")]
		[StringLength(20, ErrorMessage = "{0}长度不能超过{1}")]
		public string AddManName { get; set; }
	}
}
